<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 会员卡管理
 */
namespace app\ais\validate;
use think\Validate;

class Vip extends Validate{

    protected $rule = [
        "is_auto_up"        => "require|number|between:0,1",
        "name"              => "require",
        "rule"              => "require",
        "price"             => "require|float",
        "open_vip_num"      => "require|number",
        "open_store_num"    => "require|number",
        "pay_share_reward"  => "require|number",
        "pay_queue_reward"  => "require|number",
        "open_share_reward" => "require|float",
        "open_queue_reward" => "require|float",
        "fund"              => "require|float",
    ];

    protected $message = [
        "is_auto_up"        => "自动升级",
        "name"              => "会员名称必须填写",
        "rule"              => "会员特权必须填写",
        "price"             => "开通金额必须填写",
        "open_vip_num"      => "自动升级会员数必须填写",
        "open_store_num"    => "自动升级商家数必须填写",
        "pay_share_reward"  => "买单消费奖励比例必须填写",
        "pay_queue_reward"  => "买单消费门店会员奖励比例填写",
        "open_share_reward" => "会员开通直推奖必须填写",
        "open_queue_reward" => "会员开通间推奖必须填写",
        "fund"              => "采购基金金额必须填写",
    ];

    protected $scene = [
        'edit'   => ["is_auto_up","name","rule","price","open_vip_num","open_store_num","pay_share_reward","pay_queue_reward","open_share_reward","open_queue_reward","fund"]
    ];
}